package com.yanqu.road.entity.autodata.hotpotjump.config;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.autodata.AutoActivityConfigObject;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_hotpotjump_skill")
public class HotpotJumpSkillConfig extends AutoActivityConfigObject {
    @FieldTypeAnnotation(select = true, orderASC = true, isIndex = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "id", isIndex = true)
    private int id;
    @FieldTypeAnnotation(desc = "")
    private int sort;
    @FieldTypeAnnotation(desc = "")
    private int chooseType;
    @FieldTypeAnnotation(desc = "")
    private int triggerTiming;
    @FieldTypeAnnotation(desc = "")
    private String effect;
    @FieldTypeAnnotation(desc = "")
    private String range;
    @FieldTypeAnnotation(desc = "")
    private String name;
    @FieldTypeAnnotation(desc = "")
    private String desc;
    @FieldTypeAnnotation(desc = "")
    private int weight;
    @FieldTypeAnnotation(desc = "")
    private int maxLevel;

    public HotpotJumpSkillEffect skillEffect;
    public HotpotJumpSkillRange[] skillRanges;

    public HotpotJumpSkillConfig() {
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public int getChooseType() {
        return chooseType;
    }

    public void setChooseType(int chooseType) {
        this.chooseType = chooseType;
    }

    public int getTriggerTiming() {
        return triggerTiming;
    }

    public void setTriggerTiming(int triggerTiming) {
        this.triggerTiming = triggerTiming;
    }

    public String getEffect() {
        return effect;
    }

    public void setEffect(String effect) {
        this.effect = effect;

        this.skillEffect = new HotpotJumpSkillEffect(this.effect);
    }

    public String getRange() {
        return range;
    }

    public void setRange(String range) {
        this.range = range;

        List<HotpotJumpSkillRange> tempList = new ArrayList<>();
        for (String str : this.range.split("\\|")) {
            HotpotJumpSkillRange skillRange = new HotpotJumpSkillRange(str);
            tempList.add(skillRange);
        }
        skillRanges = tempList.toArray(new HotpotJumpSkillRange[tempList.size()]);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public int getMaxLevel() {
        return maxLevel;
    }

    public void setMaxLevel(int maxLevel) {
        this.maxLevel = maxLevel;
    }
}